Motion compensation is a key ingredient of many video compression standards. The older MPEG-2 standard uses two motion vectors in the formation of the prediction of its B-type macroblock. In MPEG-2 encoded data streams, B-type frames may comprise a number of macroblocks. Each macroblock may comprise four blocks of 8×8 pixels, where each pixel may comprise YUV data.
FIG. 2 is a simplified diagram illustrating the relationship of a macroblock from an I-type or P-type frame and the motion vector. I-type or P-type frame 210 includes a macroblock 230 located at a particular position in the frame. B-type frame 220 relocates macroblock 230 to new position 230A as indicated by motion vector 240. Thus, a B-type frame may include motion vector data representing relocation of previously defined macroblocks of pixel data. The motion vector may represent movement of the macroblock from a previously decoded I-type or P-type frame. Thus, when decoding a B-type frame, the decoder need not decode entire macroblock data, but instead can utilize macroblock pixel data decoded from a previous I-type or P-type frame. The motion vector data can then be used to move the pixel data to a new location for the B-frame, as indicated in FIG. 2. The motion vector can actually point to a new location between pixels (½ pixel granularity) and the pixel data interpolated to form new pixel data for the B-type frame.
Recently emerging standards, such as MPEG4-2, DivX, WMV9 and H.264 (MPEG4-10), require support for a higher density of motion vectors, and their implementations require a heavier use of memory. WMV9 has a 4MV mode, which defines 4 motion vectors for the same 16×16 macroblock region—one for each 8×8 sub-region. MPEG4-10 requires support for as many as 16 independent motion vectors per macroblock. MPEG4-2 has a Global Motion Compensation (GMC) mode, which defines a separate motion vector for each luminance pixel of the 16×16 macroblock, which adds up to 256 motion vectors per macroblock.
A higher motion vectors density translates to a larger number of memory fetches where each fetch comprises fewer reference pixels. In the case of MPEG4-10, each row fetched may consist of as few as 4 pixels (32 bits). In the case of the MPEG4-2 GMC mode, each row might only be 2 pixels wide (16 bits).
These more recent compression standards also have higher memory bandwidth requirements. From the IC and system point of view, higher bandwidth requirements translate to a wider memory data path. Synchronous DRAM is widely used today including a variant called DDR (double-data-rate) DRAM. The smallest randomly readable 32-bit DDR DRAM word is 64-bits wide since one address reads data on both the rising and falling edges of the clock. Likewise, a 64-bit DDR DRAM has a 128-bit effective word size.
The combination of smaller reference block sizes and a larger memory data path results in more wasted motion compensation related memory bandwidth. Non-aligned reads fetch unused pixels to the left and to the right of the required pixels. Also, typically a great deal of overlap exists between motion vectors since they are more likely to point to the same memory words. Certain memory words are therefore fetched multiple times as they are used for separate motion compensation operations based on separate motion vectors.
Thus, it remains a requirement in the art to provide a technique for minimizing memory bandwidth used for motion compensation in video compression decoding.